/*
 * Copyright (c) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import {glb} from './test2.ts'
class A {
    y: number;

    foo(x: number): number {
        if (x > 0) {
            return x + 2;
        } else {
            return x;
        }
    }
}

let out = 10;
let out2 = 9;

function test1(): number {
  let a = new A();
  let x = a.y + out;
  a.y = 20;
  let x2 = out;
  x = a.foo(x);
  let b = a.foo(out);
//   out = 30;
  let x3 = out2;

  if (a.y > 15) {
    x = 30;
  } else {
    a.y = 40;
  }

  let z = x + a.y;
  return z;
}

function test2(input: number): void {
    let x = 1;
    let y = 2;
    let tmp = glb
    let z = tmp.y;
    do {
        x = x + 1;
        if(input > 0) {
            y = x;
        } else {
            z = z * 2;
            y = x + 1;
        }
        z = x + y;
    } while (z < 10);
    z = x * y;
}

